<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <!-- INTERFACE -->
    <cc:interface>
        <cc:attribute name="bill" />
        <cc:attribute name="duplicate" />
        <cc:attribute name="reprint" />
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>

        <div style="page-break-after: always; page-break-inside: avoid; min-width: 5cm; min-height: 5cm;">
            <div style="height:13.5cm!important; width:12cm!important; padding:0.0cm; overflow:hidden!important; page-break-after:always; font-family: sans-serif; font-size: 11px!important; position: relative;  margin: 0px; background-size: 100% auto; " >

                <h:outputLabel value="#{cc.attrs.bill.deptId}"
                               style="position:absolute;left:4.5cm; top:1.1cm;"  >
                </h:outputLabel>

                <h:outputLabel value="#{cc.attrs.bill.cc.attrs.billDate}"
                               style="position: absolute; left: 9.8cm; top:1.1cm;" >
                    <f:convertDateTime pattern="dd/MM/yy"/>
                </h:outputLabel>

                <h:outputLabel value="#{cc.attrs.bill.paymentScheme.name}"
                               style="position:absolute;left:4.5cm; top:1.6cm;"  >
                </h:outputLabel>

                <h:outputLabel value="#{cc.attrs.bill.billTime}"
                               style="position: absolute; left: 9.8cm; top:1.6cm;" >
                    <f:convertDateTime pattern="hh mm ss a"/>
                </h:outputLabel>

                <h:outputLabel value="#{cc.attrs.bill.patient.person.nameWithTitle}"
                               style="position:absolute;left:4.5cm; top:2.0cm; text-transform: capitalize; "  >
                </h:outputLabel>

                <h:outputLabel value="#{cc.attrs.bill.patient.person.phone}"
                               style="position: absolute;left:4.5cm; top:2.5cm;"  >
                </h:outputLabel>

                <h:outputLabel value="Cashier : #{cc.attrs.bill.creater.code}"
                               style="position:absolute;left:2.0cm; top:12.0cm;"  >
                </h:outputLabel>

                <h:outputLabel value="#{cc.attrs.bill.collectingCentre.name} #{cc.attrs.bill.creditCompany.name}"
                               style="position:absolute;left:5.5cm; top:12.0cm;"  >
                </h:outputLabel>

                <h:dataTable value="#{cc.attrs.bill.billItems}" var="bip" style="position: absolute;left:1.6cm; top:3.5cm; border: 0px; "   >
                    <h:column >
                        <h:outputLabel value="#{bip.item.printName}"
                                       style="margin: 4px; font-size: 11px!important;" >
                        </h:outputLabel>
                    </h:column>
                </h:dataTable>

                <div style="position: absolute;left:9.6cm; top:3.5cm; border: 0px; text-align: right!important;"  >
                    <h:dataTable value="#{cc.attrs.bill.billItems}" var="bip1"  >
                        <h:column >
                            <h:outputLabel  value="#{bip1.grossValue}"  style="margin: 4px; font-size: 11px!important;" >
                                <f:convertNumber pattern="#,##0.00" />
                            </h:outputLabel>
                        </h:column>
                    </h:dataTable>
                </div>
                <div style="position: relative;left:3.6cm; margin-top: 0.5cm; top:8.0cm; border: 0px; text-align: right!important;" >

                    <table>
                        <tr>
                            <td>
                                <br/>
                                <br/>
                            </td>
                            <td>
                                <br/>
                                <br/>
                            </td>
                        </tr>
                        <tr>
                            <td style="min-width: 4.5cm;text-align: left;">
                                <h:outputLabel value="Total" style="font-size: 90%;  text-align: right!important;  font-size: 11px!important;   "/>
                            </td>
                            <td style="text-align: right!important; ">
                                <h:outputLabel value="#{cc.attrs.bill.total}"  style="font-size: 110%; font-weight: bold ; text-align: right!important; font-size: 11px!important;    ">
                                    <f:convertNumber pattern="#,##0.00" />
                                </h:outputLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="min-width: 4.5cm;text-align: left;">
                                <h:outputLabel  rendered="#{cc.attrs.bill.discount ne 0.0}" style="font-size: 90%;  text-align: right!important;  font-size: 11px!important;   "  value="Discount"/>
                            </td>
                            <td style="text-align: right!important; ">
                                <h:outputLabel rendered="#{cc.attrs.bill.discount ne 0.0}"   value="#{cc.attrs.bill.discount}"  style="font-size: 90%;  text-align: right!important;  font-size: 11px!important;   ">
                                    <f:convertNumber pattern="#,##0.00" />
                                </h:outputLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="min-width: 4.5cm;text-align: left;">
                                <h:outputLabel  rendered="#{cc.attrs.bill.discount ne 0.0}"    value="Net Total" style="font-size: 90%;  text-align: right!important;  font-size: 11px!important;   "/>
                            </td>
                            <td style="text-align: right!important; ">
                                <h:outputLabel  rendered="#{cc.attrs.bill.discount ne 0.0}"    value="#{cc.attrs.bill.netTotal}"  style="font-size: 110%; font-weight: bold ; text-align: right!important; font-size: 11px!important;    ">
                                    <f:convertNumber pattern="#,##0.00" />
                                </h:outputLabel>
                            </td>
                        </tr>


                    </table>

                </div>


            </div>

        </div>


    </cc:implementation>
</html>